﻿@{
    Layout = "~/subsites/Administration/Views/Shared/_AdminPopupLayout.cshtml";
}
@model OrderModel
@using Telerik.Web.Mvc.UI;
@{
    //page title
    ViewBag.Title = T("Admin.Orders.Fields.PartialRefund").Text;
}
@using (Html.BeginForm())
{
    <style>
        table {
            width: 100%;
        }

        table, th, td {
            border: 1px solid black;
            text-align: center;
            height: 20px;
        }
    </style>
    <div class="section-header">
        <div class="title">
            <img src="@Url.Content("~/subsites/Administration/Content/images/ico-sales.png")" alt="" />
            @T("Admin.Orders.Fields.PartialRefund")
        </div>
    </div>
    @Html.ValidationSummary(false)
    @Html.HiddenFor(model => model.Online)

    <p>
        <strong>
            @string.Format(T("Admin.Orders.Fields.PartialRefund.OrderInfo").Text, Model.Id)
        </strong>
    </p>
    <fieldset class="form-fields products-box">
        <h2>@T("ReturnRequests.SelectProduct(s)")</h2>
        <dl>
            <dd>
                <table class="data-table">
                    <thead>
                        <tr>
                            <th class="a-center">
                                @T("Admin.Catalog.BulkEdit.List.SearchProductName")
                            </th>
                            <th class="a-center">
                                @T("ReturnRequests.Products.Price")
                            </th>
                            <th class="a-center">
                                @T("Admin.Orders.Fields.PartialRefund.OrderProductVariant.RefundQuantity")
                            </th>
                            <th class="a-center">
                                @T("Admin.Orders.Fields.PartialRefund.OrderProductVariant.SubtotalExclTax")
                            </th>
                            <th class="a-center">
                                @T("Admin.Orders.Fields.PartialRefund.OrderProductVariant.DiscountExclTax")
                            </th>
                            <th class="a-center">
                                @T("Admin.Orders.Fields.PartialRefund.OrderProductVariant.IsRefund")
                            </th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (var item in Model.Items)
                        {
                            <tr>
                                <td class="a-left">
                                    @Html.ActionLink(item.FullProductName, "Edit", "ProductVariant", new { id = item.ProductVariantId }, new { })
                                </td>
                                <td class="a-left">
                                    @item.UnitPriceExclTax
                                </td>
                                <td class="a-left">
                                    <select name="quantity@(item.Id)" style="width: 30%;">
                                        @for (int i = 0; i <= item.Quantity; i++)
                                        {
                                            <option value="@(i)">@(i)</option>
                                        }
                                    </select>
                                </td>
                                <td class="a-left">
                                    @item.SubTotalExclTax
                                </td>
                                <td class="a-left">
                                    @item.DiscountExclTax
                                </td>
                                <td class="a-left">
                                    @item.IsRefund
                                </td>
                            </tr>
                        }
                    </tbody>
                </table>
            </dd>
        </dl>
    </fieldset>
    <div class="clear">
    </div>
    <br /><br />
    <div class="buttons">
        <input type="submit" id="partialrefundorder" class="adminButton" value="@T("Admin.Orders.Fields.Refund")" />
    </div>
}